//
// Created by 11510 on 2024/7/1.
//
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>

using std::cout;
using std::endl;
using std::vector;
using std::for_each;
using std::mem_fn;
using std::remove_if;
using std::bind;

class Number {
private:
    size_t _data;
public:
    Number(size_t data) : _data(data) {}

    void print(void) const {
        cout << _data << "  ";
    }

    ~Number() {}
};

void test() {
    vector<Number> vec;
    for (size_t idx = 1; idx != 30; ++idx) {
        vec.push_back(Number(idx));
    }

    Number num(10);
    using namespace std::placeholders;
    /**
     * for_each内部是
     * __f(*__first)
     * 所以填占位符_1
     */
    for_each(vec.begin(), vec.end(), bind(&Number::print, _1));
    cout << endl;

}

int main(int argc, char *argv[]) {
    test();
    return 0;
}